package com.rd.sys.common.fileexport;

import baseproj.common.exception.BaseServiceException;

/**
 * The Class ExportOperatorException.
 */
public class ExportOperatorException extends BaseServiceException {

    /** The Constant serialVersionUID. */
    private static final long serialVersionUID = 5078266090831176919L;

    /** 没有对应的导出类型. */
    public static final int TYPE_NOT_FIND_ERROR = 1;

    /** 创建新文件错误. */
    public static final int CREATE_NEW_FILE_ERROR = 2;

    /** 写入导出数据错误. */
    public static final int WRITE_DATA_ERROR = 3;

    /** 写入导出表头错误. */
    public static final int WRITE_HEAD_ERROR = 4;

    /** 没有找到相应的处理类. */
    public static final int NOT_FIND_OPERATOR_CLASS_ERROR = 5;

    /** 线程池已满,加入失败. */
    public static final int POOL_ALREADY_MAX_ERROR = 6;

    /** 线程执行失败. */
    public static final int THREAD_EXECUTE_FAILED_ERROR = 7;

    /**
     * Instantiates a new export operator exception.
     * 
     * @param erroCode
     *            the erro code
     */
    public ExportOperatorException(int erroCode) {
        super(erroCode);
        if (TYPE_NOT_FIND_ERROR == erroCode) {
            this.setErroDesc("未找到对应的导出类型");
        } else if (CREATE_NEW_FILE_ERROR == erroCode) {
            this.setErroDesc("创建导出文件错误");
        } else if (WRITE_DATA_ERROR == erroCode) {
            this.setErroDesc("写入导出数据错误");
        } else if (WRITE_HEAD_ERROR == erroCode) {
            this.setErroDesc("写入导出文件头错误");
        } else if (NOT_FIND_OPERATOR_CLASS_ERROR == erroCode) {
            this.setErroDesc("未找到导出处理类文件");
        } else if (POOL_ALREADY_MAX_ERROR == erroCode) {
            this.setErroDesc("导出线程池已达到最大");
        } else if (THREAD_EXECUTE_FAILED_ERROR == erroCode) {
            this.setErroDesc("导出线程执行错误");
        }
    }

}
